Release 10.1A: OpenEdge Data Management:
SQL Development


Need for integrity constraints

Integrity constraints are necessary because data in a database must be valid and consistent at all times. Data might be inconsistent because of entry errors, duplicate entries of rows, or other violations.

For example, to properly track a company’s employee information, each employee should be assigned a unique identification number. To ensure this, specify a UNIQUE constraint on the column that contains the employee number (emp_no), as shown in Example 5–10.

Example 5–10: UNIQUE constraint
 CREATE TABLE employee_info ( 
          emp_no      INTEGER NOT NULL UNIQUE, 
          first_name  VARCHAR(20) NOT NULL, 
          last_name   VARCHAR(20) NOT NULL, 
          title       VARCHAR(20) 
     ) ; 


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095